//
//  WBHomeViewController.swift
//  学习微博
//
//  Created by zengyu on 2017/9/3.
//  Copyright © 2017年 weibo. All rights reserved.
//

import UIKit

class WBHomeViewController: WBBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
                
    }
    //显示消息列表
    @objc fileprivate func showMessages(){
        let vc = WBMessageViewController()
        
        //隐藏底部tabbar
       // vc.hidesBottomBarWhenPushed = true
        navigationController?.pushViewController(vc, animated: true)
    }
}


// MARK: - 设置界面
extension WBHomeViewController {
    
    //重写父类的方法
    override func setupUI(){
        super.setupUI()
        
        //设置导航栏按钮 
        //无法高亮
        //navigationItem.leftBarButtonItem = UIBarButtonItem(title: "消息", style: .plain, target: self, action: #selector(showMessages))
        //Swift 调用 OC 返回的instancetype的方法，判断不出是否可选
//        let btn:UIButton = UIButton.cz_textButton("好友", fontSize: 16, normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
//        
//        btn.addTarget(self, action: #selector(showMessages), for: .touchUpInside)
//        
//        navigationItem.leftBarButtonItem = UIBarButtonItem(customView: btn)
        navItem.leftBarButtonItem = UIBarButtonItem(title: "好友", fontsize: 16, target: self, action: #selector(showMessages))
    }
}
